using System;

internal sealed class Class2 : Class1
{
	private const int int_0 = 624;

	private const int int_1 = 397;

	private const uint uint_0 = 2567483615u;

	private const uint uint_1 = 2147483648u;

	private const uint uint_2 = 2147483647u;

	private const double double_0 = 4.6566128730773926E-10;

	private const double double_1 = 2.3283064365386963E-10;

	private uint[] uint_3;

	private uint uint_4;

	private uint uint_5;

	private uint[] uint_6;

	private uint uint_7;

	private int int_2;

	public Class2()
	{

	}

	public Class2(int int_3)
	{

	}

	public Class2(uint uint_8)
	{
		uint_3 = new uint[624];
		uint_5 = uint_8;
		uint_6 = null;
		method_0();
	}

	public Class2(int[] int_3)
	{
		if (int_3 == null)
		{
			throw new Exception("seedArray参数不能为空");
		}
		uint_3 = new uint[624];
		uint_5 = 19650218u;
		uint_6 = new uint[int_3.Length];
		for (int i = 0; i < int_3.Length; i++)
		{
			uint_6[i] = (uint)Math.Abs(int_3[i]);
		}
		method_0();
	}

	public Class2(uint[] uint_8)
	{
		if (uint_8 == null)
		{
			throw new Exception("seedArray参数不能为空");
		}
		uint_3 = new uint[624];
		uint_5 = 19650218u;
		uint_6 = uint_8;
		method_0();
	}

	private void method_0()
	{
		uint_3[0] = (uint)((int)uint_5 & -1);
		for (uint_4 = 1u; uint_4 < 624; uint_4++)
		{
			uint_3[uint_4] = 1812433253 * (uint_3[uint_4 - 1] ^ (uint_3[uint_4 - 1] >> 30)) + uint_4;
		}
		if (uint_6 != null)
		{
			method_1();
		}
		uint_7 = 0u;
		int_2 = 32;
	}

	private void method_1()
	{
		uint num = 1u;
		uint num2 = 0u;
		for (int num3 = (624 > uint_6.Length) ? 624 : uint_6.Length; num3 > 0; num3--)
		{
			uint_3[num] = (uint_3[num] ^ ((uint_3[num - 1] ^ (uint_3[num - 1] >> 30)) * 1664525)) + uint_6[num2] + num2;
			num++;
			num2++;
			if (num >= 624)
			{
				uint_3[0] = uint_3[623];
				num = 1u;
			}
			if (num2 >= uint_6.Length)
			{
				num2 = 0u;
			}
		}
		for (int num3 = 623; num3 > 0; num3--)
		{
			uint_3[num] = (uint_3[num] ^ ((uint_3[num - 1] ^ (uint_3[num - 1] >> 30)) * 1566083941)) - num;
			num++;
			if (num >= 624)
			{
				uint_3[0] = uint_3[623];
				num = 1u;
			}
		}
		uint_3[0] = 2147483648u;
	}

	private void method_2()
	{
		uint[] array = new uint[2]
		{
			0u,
			2567483615u
		};
		int i;
		uint num;
		for (i = 0; i < 227; i++)
		{
			num = (uint)(((int)uint_3[i] & int.MinValue) | (int)(uint_3[i + 1] & int.MaxValue));
			uint_3[i] = (uint_3[i + 397] ^ (num >> 1) ^ array[num & 1]);
		}
		for (; i < 623; i++)
		{
			num = (uint)(((int)uint_3[i] & int.MinValue) | (int)(uint_3[i + 1] & int.MaxValue));
			uint_3[i] = (uint_3[i + -227] ^ (num >> 1) ^ array[num & 1]);
		}
		num = (uint)(((int)uint_3[623] & int.MinValue) | (int)(uint_3[0] & int.MaxValue));
		uint_3[623] = (uint_3[396] ^ (num >> 1) ^ array[num & 1]);
		uint_4 = 0u;
	}

	public uint method_3()
	{
		if (uint_4 >= 624)
		{
			method_2();
		}
		uint num = uint_3[uint_4++];
		num ^= num >> 11;
		num = (uint)((int)num ^ ((int)(num << 7) & -1658038656));
		num = (uint)((int)num ^ ((int)(num << 15) & -272236544));
		return num ^ (num >> 18);
	}

	public int UuGxyHhRG()
	{
		if (uint_4 >= 624)
		{
			method_2();
		}
		uint num = uint_3[uint_4++];
		num ^= num >> 11;
		num = (uint)((int)num ^ ((int)(num << 7) & -1658038656));
		num = (uint)((int)num ^ ((int)(num << 15) & -272236544));
		num ^= num >> 18;
		return (int)(num >> 1);
	}

	public override bool vmethod_0()
	{
		return true;
	}

	public override bool vmethod_1()
	{
		method_0();
		return true;
	}

	public override int vmethod_2()
	{
		if (uint_4 >= 624)
		{
			method_2();
		}
		uint num = uint_3[uint_4++];
		num ^= num >> 11;
		num = (uint)((int)num ^ ((int)(num << 7) & -1658038656));
		num = (uint)((int)num ^ ((int)(num << 15) & -272236544));
		num ^= num >> 18;
		int num2 = (int)(num >> 1);
		if (num2 == int.MaxValue)
		{
			return vmethod_2();
		}
		return num2;
	}

	public override int vmethod_3(int int_3)
	{
		if (int_3 < 0)
		{
			throw new Exception("maxValue参数值不能小于0");
		}
		if (uint_4 >= 624)
		{
			method_2();
		}
		uint num = uint_3[uint_4++];
		num ^= num >> 11;
		num = (uint)((int)num ^ ((int)(num << 7) & -1658038656));
		num = (uint)((int)num ^ ((int)(num << 15) & -272236544));
		num ^= num >> 18;
		return (int)((double)(int)(num >> 1) * 4.6566128730773926E-10 * (double)int_3);
	}

	public override int vmethod_4(int int_3, int int_4)
	{
		if (int_3 > int_4)
		{
			throw new Exception("minValue不能大于maxValue");
		}
		if (uint_4 >= 624)
		{
			method_2();
		}
		uint num = uint_3[uint_4++];
		num ^= num >> 11;
		num = (uint)((int)num ^ ((int)(num << 7) & -1658038656));
		num = (uint)((int)num ^ ((int)(num << 15) & -272236544));
		num ^= num >> 18;
		int num2 = int_4 - int_3;
		if (num2 < 0)
		{
			return int_3 + (int)((double)num * 2.3283064365386963E-10 * ((double)int_4 - (double)int_3));
		}
		return int_3 + (int)((double)(int)(num >> 1) * 4.6566128730773926E-10 * (double)num2);
	}

	public override double vmethod_5()
	{
		if (uint_4 >= 624)
		{
			method_2();
		}
		uint num = uint_3[uint_4++];
		num ^= num >> 11;
		num = (uint)((int)num ^ ((int)(num << 7) & -1658038656));
		num = (uint)((int)num ^ ((int)(num << 15) & -272236544));
		num ^= num >> 18;
		return (double)(int)(num >> 1) * 4.6566128730773926E-10;
	}

	public override double vmethod_6(double double_2)
	{
		if (double_2 < 0.0)
		{
			throw new Exception("maxValue参数值不能小于0.0");
		}
		if (uint_4 >= 624)
		{
			method_2();
		}
		uint num = uint_3[uint_4++];
		num ^= num >> 11;
		num = (uint)((int)num ^ ((int)(num << 7) & -1658038656));
		num = (uint)((int)num ^ ((int)(num << 15) & -272236544));
		num ^= num >> 18;
		return (double)(int)(num >> 1) * 4.6566128730773926E-10 * double_2;
	}

	public override double vmethod_7(double double_2, double double_3)
	{
		if (double_2 > double_3)
		{
			throw new Exception("minValue不能大于maxValue");
		}
		double num = double_3 - double_2;
		if (num == double.PositiveInfinity)
		{
			throw new Exception("minValue或maxValue超出范围");
		}
		if (uint_4 >= 624)
		{
			method_2();
		}
		uint num2 = uint_3[uint_4++];
		num2 ^= num2 >> 11;
		num2 = (uint)((int)num2 ^ ((int)(num2 << 7) & -1658038656));
		num2 = (uint)((int)num2 ^ ((int)(num2 << 15) & -272236544));
		num2 ^= num2 >> 18;
		return double_2 + (double)(int)(num2 >> 1) * 4.6566128730773926E-10 * num;
	}

	public override bool vmethod_8()
	{
		if (int_2 == 32)
		{
			if (uint_4 >= 624)
			{
				method_2();
			}
			uint num = uint_3[uint_4++];
			num ^= num >> 11;
			num = (uint)((int)num ^ ((int)(num << 7) & -1658038656));
			num = (uint)((int)num ^ ((int)(num << 15) & -272236544));
			uint_7 = (num ^ (num >> 18));
			int_2 = 1;
			return (uint_7 & 1) == 1;
		}
		int_2++;
		return ((uint_7 >>= 1) & 1) == 1;
	}

	public override void vmethod_9(byte[] byte_0)
	{
		if (byte_0 == null)
		{
			throw new Exception("buffer参数值不能为空");
		}
		int num = 0;
		uint num2;
		while (num < byte_0.Length - 3)
		{
			if (uint_4 >= 624)
			{
				method_2();
			}
			num2 = uint_3[uint_4++];
			num2 ^= num2 >> 11;
			num2 = (uint)((int)num2 ^ ((int)(num2 << 7) & -1658038656));
			num2 = (uint)((int)num2 ^ ((int)(num2 << 15) & -272236544));
			num2 ^= num2 >> 18;
			byte_0[num++] = (byte)num2;
			byte_0[num++] = (byte)(num2 >> 8);
			byte_0[num++] = (byte)(num2 >> 16);
			byte_0[num++] = (byte)(num2 >> 24);
		}
		if (num >= byte_0.Length)
		{
			return;
		}
		if (uint_4 >= 624)
		{
			method_2();
		}
		num2 = uint_3[uint_4++];
		num2 ^= num2 >> 11;
		num2 = (uint)((int)num2 ^ ((int)(num2 << 7) & -1658038656));
		num2 = (uint)((int)num2 ^ ((int)(num2 << 15) & -272236544));
		num2 ^= num2 >> 18;
		byte_0[num++] = (byte)num2;
		if (num >= byte_0.Length)
		{
			return;
		}
		byte_0[num++] = (byte)(num2 >> 8);
		if (num < byte_0.Length)
		{
			byte_0[num++] = (byte)(num2 >> 16);
			if (num < byte_0.Length)
			{
				byte_0[num] = (byte)(num2 >> 24);
			}
		}
	}
}
